
var React = require("react");

var VoaApp = require("./components/VoaApp.js");

var Backbone = require("backbone");

var _= require("lodash");

var $ = require("jquery");

var FetchData = require("./util/FetchData.js")

var Collection = require("./collection/Collection.js");


var Router = Backbone.Router.extend({
    
    
    getInitialState: function(){
        
        return {
            
            isLoading:false
            
        }
        
    },

   routes :{

		  "": "index",
          "detaillist/:id" :"detaillist"


	},

	index: function(){

         var collection  =new Collection();

         collection.url="/api/Technology_Report_1.html";

        var promise= new FetchData().fetchData(collection);

          $.when(promise).done(function(data){
          	    if(data!==undefined){

		 React.render(<VoaApp  collection ={collection} isLoading = {this.state.isLoading} />,

         	document.getElementById("app")
			);
          }


	});
   }


});


new Router();


Backbone.history.start();
